#include <stdio.h>

int sum(int *arr, int size)
{
    int sum = 0;
    int *p = arr;
    for(int i = 0; i < size; i++)
    {
        sum += *p;
        p++;
    }
    return sum;
}

int main()
{
    int arr[5] = {1 ,2 ,3 ,4 ,5};
    int size = sizeof(arr)/sizeof(arr[0]);
    int total = sum(arr, size);
}